<?php
	include("access/login_functions.php");
	require("access/connect.php");
	
	if(isset($_POST['newpgrk'])){
		$newpr = $_POST['newpgrk'];
		$file = $_POST['file'];
		
		foreach($newpr as $key=>$pr){
			if(!empty($pr)){
				$pr = floatval($pr);
				mysql_query("UPDATE articles_table SET pagerank = $pr WHERE filename='$file[$key]'")or die("PageRank could not be updated. ".mysql_error());
			}
		}
	}
	send_to_page("editpagerank.php");
?>